//
//  TYState.m
//  AngerDragon
//
//  Created by gaotime_macbook_2 on 11-12-11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "TYStateSystem.h"
#import "cocos2d.h"

@implementation TYStateSystem
- (id) init {
	
	if ((self = [super init])) {
		CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
		
		m_n_currently_state = 0;
		m_n_last_state = 0;
	}
	
	return self;
}

- (void) dealloc {
	CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
	
	[super dealloc];
}

#pragma mark 实现状态机系统接口

/// 设置状态机
- (void) setState:(NSInteger) a_n_state {
	m_n_last_state = m_n_currently_state;
	m_n_currently_state = a_n_state;
}

/// 获取当前状态机
- (NSInteger) getCurrentlyState {
	return m_n_currently_state;
}

/// 获取上一个状态机
- (NSInteger) getLastState {
	return m_n_last_state;
}

/// 释放状态机接口对象
- (void) deallocMe {
	[self dealloc];
}

#pragma mark -----------------
@end
